package com.app.newiptv.promote;

import android.text.TextUtils;

import com.app.newiptv.bean.RequestDto;
import com.app.newiptv.callback.IRequestLisenter;
import com.app.newiptv.utils.APPLog;
import com.app.newiptv.utils.OkGoUtil;

import org.json.JSONException;
import org.json.JSONObject;

public class UserRecodeRunnable {


    public void loadData(String url, String id, String type) {

        OkGoUtil<String> okGoUtil = new OkGoUtil<String>(String.class, OkGoUtil.TYPE_STRING, new IRequestLisenter() {
            @Override
            public void onSuccessData(RequestDto dto) {

            }

            @Override
            public void onErrer(int code, String errMsg) {

            }
        });
        APPLog.printInfo("id:" + id + " type:" + type);
        JSONObject jsonObject = new JSONObject();
        try {
            if (!TextUtils.isEmpty(id)) {
//            okGoUtil.params("id", id);
                jsonObject.accumulate("id", id);
            }
            jsonObject.accumulate("type", type);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        okGoUtil.postJson(url, jsonObject.toString());
    }

}
